package wiktionary.to.xml.full.jpa;

// Generated Oct 28, 2013 11:11:01 AM by Hibernate Tools 3.4.0.CR1

import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * WordEntry generated by hbm2java
 */
@Entity
@Table(name = "wordentry")
public class WordEntry implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
    private Integer id;
    private WordEtym wordEtym;
    private String dataField;
    private String pos;
    private Set<Sense> senses = new LinkedHashSet<Sense>(0);

    public WordEntry() {
    }

    public WordEntry(WordEtym wordEtym, String pos) {
        this.wordEtym = wordEtym;
        this.pos = pos;
    }

    public WordEntry(WordEtym wordEtym, String dataField, String pos, Set<Sense> senses) {
        this.wordEtym = wordEtym;
        this.dataField = dataField;
        this.pos = pos;
        this.senses = senses;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    public Integer getId() {
        return this.id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "wordetym_id", nullable = false)
    public WordEtym getWordEtym() {
        return this.wordEtym;
    }

    public void setWordEtym(WordEtym wordEtym) {
        this.wordEtym = wordEtym;
    }

    @Column(name = "dataField", length = 45)
    public String getDataField() {
        return this.dataField;
    }

    public void setDataField(String dataField) {
        this.dataField = dataField;
    }
    
    @Column(name = "pos", nullable = false, length = 45)
	public String getPos() {
		return this.pos;
	}

	public void setPos(String pos) {
		this.pos = pos;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "wordEntry")
	public Set<Sense> getSenses() {
		return this.senses;
	}

	public void setSenses(Set<Sense> senses) {
		this.senses = senses;
	}
}
